package com.you.learning.jvm.jstat;

/**
 * @Description
 * @Author yough
 * @Version V1.0.0
 * @Since 1.0
 * @Date 2021/2/1
 */
public class JstatMonitorJVMDemo {

    public static void main(String[] args) throws InterruptedException {
        /**
         * 使用jstat -gc pid监控jvm的内存和gc使用情况
         */
        Thread.sleep(30 * 1000L);
        System.out.println("---------start---------");
        while (true) {
            byte[] byte1 = new byte[2 * 1024 * 1024];
            byte1 = new byte[3 * 1024 * 1024];
            byte1 = new byte[2 * 1024 * 1024];
            byte1 = new byte[128 * 1024];
            byte1 = null;
            byte[] byte2 = new byte[2 * 1024 * 1024];
            Thread.sleep(1000L);
        }
    }
}
